package com.qf.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.mapper.DtsUserMapper;
import com.qf.mapper.statMapper;
import com.qf.pojo.DtsUser;
import com.qf.service.UserService;
import com.qf.vo.DayStatis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class UserServiceImpl implements UserService {


    @Autowired
    private DtsUserMapper dtsUserMapper;

    @Autowired
    private statMapper statMapper;

    @Override
    public int count() {

        QueryWrapper<DtsUser> wrapper = new QueryWrapper<>();
        wrapper.eq("deleted", false);
        Integer count = dtsUserMapper.selectCount(wrapper);
        return count;
    }

    @Override
    public List<DayStatis> recentCount(int statisDaysRang) {
        List<DayStatis> list = statMapper.statisIncreaseUserCnt(statisDaysRang);
        return list;
    }
}
